<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" id="html">
    <head>
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <base href="<?= base_url(1); ?>" />
        <link type="text/css" href="css/main.css?v=<?= $config['version'] ?>" rel="stylesheet" />
    </head>
    <body>
        <?php include(VIEWPATH . 'common/main_header.php'); ?>
        <form action="" method="POST" id="rowForm">
            <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tablegrid tableedit">
                <tr><td><?= translate('AREA_ID') ?>:</td><td><input type="text" name="row[SvrID]" id="id" size="25" value="<?= $row['SvrID'] ?>" /></td></tr>
<!--                <tr><td><?= translate('AREA_FATHER_ID') ?>:</td><td><?= $fatherlist; ?></td></tr>-->
                <tr><td><?= translate('AREA_NAME') ?>:</td><td><input type="text" name="row[SvrName]" id="name" size="50" value="<?= $row['SvrName'] ?>" /></td></tr>
<!--                <tr><td><?= translate('AREA_URL') ?>:</td><td><input type="text" name="row[url]" id="url" size="50" value="<?= $row['url'] ?>" /></td></tr>-->
                <tr><td><?= translate('AREA_HOST') ?>:</td><td><input type="text" name="row[SvrOutAddr]" id="host" size="50" value="<?= $row['SvrOutAddr'] ?>" /></td></tr>
<!--               <tr><td><?= translate('AREA_PLAYERS') ?>:</td><td><input type="text" name="row[players]" id="players" size="25" value="<?= $row['players'] ?>" /></td></tr>
               <tr><td><?= translate('AREA_WEIGH') ?>:</td><td><input type="text" name="row[weigh]" id="weigh" size="25" value="<?= $row['weigh'] ?>" /></td></tr>
                <tr><td><?= translate('AREA_ODDS') ?>:</td><td><input type="text" name="row[odds]" id="odds" size="25" value="<?= $row['odds'] ?>" /></td></tr>-->
                <tr><td><?= translate('AREA_OPENTIME') ?>:</td><td><input type="text" name="row[SvrOpenTime]" id="opentime" size="25" value="<?= date("Y-m-d H:i:s", $row['SvrOpenTime']) ?>" class="datepicker" showtime="true" /></td></tr>
<!--                <tr>
                    <td><?= translate('C_ALLOW_VERSION') ?>:</td>
                    <td>
                        <textarea name="row[version]" id="version" cols="50" rows="3"><?= implode("\r\n", $row['version']) ?></textarea><a href="javascript:;" class="help" module="version"><?= translate('README') ?></a>
                    </td>
                </tr>-->
                <tr><td><?= translate('STATUS') ?>:</td><td>
                        <?php foreach ($statelist as $m => $n) { ?>
                            <input type="radio" name="row[SvrState]" value="<?= $m ?>" id="s<?= $m ?>" <?= checkchecked($m, $row['SvrState']) ?> /><label for="s<?= $m ?>"><?= $n ?></label> &nbsp;
                        <?php } ?>
                    </td></tr>
<!--                <tr><td>--><?//= translate('FLAG') ?><!--:</td><td>-->
<!--                        --><?php //foreach ($flaglist as $m => $n) { ?>
<!--                            <input type="radio" name="row[flag]" value="--><?//= $m ?><!--" id="s--><?//= $m ?><!--" --><?//= checkchecked($m, $row['flag']) ?><!-- /><label for="s--><?//= $m ?><!--">--><?//= $n ?><!--</label> &nbsp;-->
<!--                        --><?php //} ?>
<!--                    </td></tr>-->
                <tr><td></td><td><input type="submit" value="<?= translate('SUBMIT') ?>" id="submit"/> <input type="reset" value="<?= translate('RESET') ?>" id="reset"/></td></tr>
            </table>
        </form>
        <script type="text/javascript">
            SG.init("core.form", function() {
                $.formValidator.initConfig({formid: "#rowForm", submitonce: true});
                $("#id").formValidator({empty: false, onshow: '<?= translate('C_ONLY_ONE') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#father_id").formValidator({empty: true, onshow: '<?= translate('AREA_FORM_INPUT_FATHER_ID') ?>'});
                $("#name").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#players").formValidator({empty: false, onshow: '<?= translate('C_ONLY_NUM') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                $("#weigh").formValidator({empty: false, onshow: '<?= translate('C_ONLY_NUM') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                $("#odds").formValidator({empty: false, onshow: '<?= translate('C_ONLY_NUM') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                $("#version").formValidator({empty: true, onshow: '<?= translate('AREA_FORM_INPUT_VERSION') ?>'});
                $("#url").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#host").formValidator({empty: false, onshow: '<?= translate('AREA_FORM_INPUT_HOST') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#opentime").formValidator({empty: false, onshow: '<?= translate('AREA_FORM_INPUT_OPENTIME') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
            });
        </script>
    </body>
</html>